export default {
    state: {
        userInfo:{},
        roles:["超级管理员","管理员"]
    },
    getters: {
        hasPermission: (state) => (permission) => {
            // 简单例子中直接检查角色，实际可能需要更复杂的逻辑
            return state.roles.includes(permission);
        },
    },
    mutations : {
        setUserInfo(state,user){
            state.userInfo = user
        },
        delUserInfo(state){
            state.userInfo = {}
        }
    }
}
